#pragma once
#include"SceneBase.h"
#include"../jsonCpp/json.h"
#include"MonsterGroup.h"

class MonsterHoleScene:public SceneBase
{
public:
	MonsterHoleScene(Object* master, int sceneId);
	virtual ~MonsterHoleScene();

	virtual void addActor(const int& id, const int64_t& sock, const Myvec& pos, const Myvec& forward, const std::string& name);

	virtual void removeActor(const int& id);

	virtual void updateActorTransform(const int& id, const Myvec& pos, const Myvec& forward, const Myvec& veloci);

	virtual	void updateActorPosAndFor(const int& id, const Myvec& pos, const Myvec& foprward);

	virtual std::vector<GamePlay*> getGamePlayNearPlayers(const int& id);

	virtual void monsterFight(const int& monsterId, const int& figtId);

	virtual void monsterFightResult(const int& userId, const int& monsterId, const int& success);

private:
	void notifyTeamMembers(GamePlay* play, bool isAdd = false);

	void notifyPlayLeaveView(GamePlay* play, GamePlay* otherPlay);

	void getPlayUpdateVelocity(GamePlay* play, Json::Value* smessage);

	virtual void notifyMonster(GamePlay* play);

	void addMonsterGroup(GamePlay* play);

	void monsterRemoveFightNotify(Json::Value& message);

	std::map<int, MonsterGroup> m_monsterGroupMaps;

	static int GLOBAL_GROUP_ID;
};
